<%@ include file="/header.jsp" %>

<h1>Artists</h1>

<form>
    <table cellspacing="0" style="margin:10px">
	<tr>
	    <td><b>Filter Mode:<b></td>
	    <td><input type="radio" name="smode" value="all"/>All</td>
	    <td><input type="radio" name="smode" value="singer"/>Singer</td>
	    <td><input type="radio" name="smode" value="band"/>Band</td>
	    <td><input type="submit" value="Filter"/></td>
	</tr>
    </table>
</form>
<p style="margin:10px"><a href="/lab02-music-portal/music/add_singer">Add Singer</a><br/>
<a href="/lab02-music-portal/music/add_band">Add Music Band</a></p>

<table border="1" width="90%" cellspacing="0" style="margin:10px">
<col width="5%" /><col width="40%" /><col width="45%" /><col width="10%" />
    <thead>
        <tr>
            <td><b>Id</b></td>
            <td><b>Name/Title</b></td>
            <td><b>Artist Type</b></td>
            <td><b>Delete</b></td>
        </tr>
    </thead>
    <tbody>
        <c:forEach var="singer" items="${singer_list}">
            <tr>
            <td>
             <a href="/lab02-music-portal/music/add_singer?id=${singer.id}"> <c:out value="${singer.id}"/></a>     
            </td>
            <td>
                <c:out value="${singer.name}"/></a>
            </td>
            <td>
                Singer
            </td>
            <td>
				<c:choose>
				<c:when test="${singer.updateGranted}">
				<a href="/lab02-music-portal/music/delete_artist?id=${singer.id}">Delete</a>
				</c:when>
				<c:otherwise>
				<p>Not allowed</p>
				</c:otherwise>
				</c:choose>                      
            </td>
            </tr>
        </c:forEach>
        <c:forEach var="band" items="${band_list}">
            <tr>
            <td>
	            <a href="/lab02-music-portal/music/add_band?id=${band.id}"> <c:out value="${band.id}"/></a>
            </td>
            <td>
                <c:out value="${band.title}"/></a>
            </td>
            <td>
                MusicBand
            </td>
            <td>
				<c:choose>
				<c:when test="${band.updateGranted}">
				<a href="/lab02-music-portal/music/delete_artist?id=${band.id}">Delete</a>
				</c:when>
				<c:otherwise>
				<p>Not allowed</p>
				</c:otherwise>
				</c:choose>                  
            </td>
            </tr>
        </c:forEach>

    </tbody>
</table>

<%@ include file="/footer.jsp" %>
</html>
